<div class="rgd2_d1"></div>
<?php
	foreach($userDynamic as $ud) {
	
?>
<div class="rgd2_d2">
	<div class="sead2_1"><img src="<?=base_url()?>assets/<?=$ud['userBigIocn']?>" width="62" height="62" /></div>
	<div class="sead2_2 tdzy_rig2">
		<p class="sead2_p1"><?=$ud['createTime']?></p>
		<!--p class="sead2_p2"><strong class="sead2_stg1">NEMON摄影</strong> <strong class="sead2_stg2"><?=$ud['nickName']?> ： 发布展示 ></strong> <strong class="sead2_stg3">LNB-XG-02</strong></p-->
		<p class="sead2_p2"><strong class="sead2_stg2"><?=$ud['nickName']?> ： 发布展示 ></strong></p>
		<p class="sead2_p3"><?=$ud['description']?></p>
		<div style="width:100%" class="div_display" id="div_display_<?=$ud['id']?>">
			<form id="replyForm" method="post" action="<?=base_url()?>index.php/team/replayUsersDynamic">
				<textarea name="reply_content" id="reply_content_<?=$ud['id']?>" rows="7" style="width:630px;"></textarea>
				<input type="hidden" name="dynamicId" id="dynamicId_<?=$ud['id']?>" value="<?=$ud['id']?>"/>
				<input type="button" class="send_btn" title="<?=$ud['id']?>" style="float:right;margin-top:10px;">
			</form>
		</div>
		<p class="sead2_p4 tdzy_rip2">
			<span>
				<a href="javascript:void(0);" class="dynamic_reply" title="<?=$ud['id']?>"><strong class="sead2_stg5">回应(<?=$ud['replyCount']?>)</strong></a>
				<a href="javascript:void(0);" class="dynamic_forward" title="<?=$ud['id']?>"><strong class="sead2_stg5">转发</strong></a>
			</span>
			<a href="<?=base_url()?>index.php/team/queryDynamicContent/<?=$ud['id']?>/<?=$teamId?>" target="_blank"><strong class="sead2_stg4">阅读全部>></strong></a>
		</p>
	</div>	
</div>
<div class="rgd2_d3"></div>
<?php
}
?>
<script type="text/javascript">
	$(function() {
		$(".dynamic_reply").each(function() {
			$(this).click(function() {
				var id = $(this).attr("title");
				$("#div_display_"+id).toggle("div_display");
			});
		});
		$(".dynamic_forward").each(function() {
			$(this).click(function() {
				var id = $(this).attr("title");
				$.ajax({
					type:"POST",
					url:"<?=base_url()?>index.php/team/forward",
					data:"dynamicId="+id,
					success:function() {
						alert("转发成功");
						//location.reload();
					}
				});
			});
		});
		
		$(".send_btn").each(function() {
			$(this).click(function() {
				var id = $(this).attr("title");
				var reply_content = $("#reply_content_"+id).val();
				var dynamicId = $("#dynamicId_"+id).val();
				if(reply_content.length<=0) {
					alert("请输入回复内容");
					return false;
				}
				$.ajax({
					type:"POST",
					url:"<?=base_url()?>index.php/team/replayUsersDynamic",
					data:"reply_content="+reply_content+"&dynamicId="+dynamicId,
					success:function() {
						$("#reply_content_"+id).val("");
						location.reload();
					}
				});
			});
		});
	})
</script>